package cn.ljy.mes.model;

import cn.ljy.common.model.BaseModel;
import cn.ljy.common.model.validate.AddWorkValidation;
import cn.ljy.common.model.validate.UpdateWorkValidation;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

@ApiModel(value="车型")
@Data
@NoArgsConstructor
@EqualsAndHashCode(callSuper = false,of = {"id"})
public class MesCarModel extends BaseModel {
    @NotNull(groups = UpdateWorkValidation.class,message="id不能为空")
    private String id;
    @NotNull(groups = AddWorkValidation.class,message="品牌不能为空")
    private MesCarBrand carBrand;//汽车品牌
    @NotBlank(message = "名称不能为空")
    @Length(min = 1, max = 30, message = "名称长度必须在 {min} - {max} 之间")
    private String name;//车型名称，如凯美瑞
    @NotBlank(groups = AddWorkValidation.class,message="汽车类型不能为空")
    private String type;//汽车类型：轿车、SUV、MPV。由数据词典决定
    @NotBlank(groups = AddWorkValidation.class,message="汽车能源类型不能为空")
    private String energyType;//汽车类型：汽车能源类型：燃油、新能源、插电式混动、混动.
    @NotBlank(groups = AddWorkValidation.class,message="汽车大小不能为空")
    private String sizeType;//汽车大小类型：微型、紧凑型、中型、中大型、大型
    @NotNull(groups = AddWorkValidation.class,message="停产状态不能为空")
    private Boolean stopProduction;//是否停产，true表示停产
    @NotNull(groups = AddWorkValidation.class,message="启用状态不能为空")
    private Boolean enabled;//是否启用,true表示启用

    //非数据库字段
    private Integer carTechnologyNumber;//工艺数量
    private Integer carModelConfigNumber;//配置数量

    public MesCarModel(String id) {
        this.id = id;
    }
}
